package com.boarsoft.message.rocketmq;

import com.boarsoft.message.core.MessageService;

/**
 * 基于ActiveMQ客户端完成JMS消息的外发<br>
 * 应用可以直接使用ActiveMQ的API完成外发，也可以通过本类来完成<br>
 * 将AmqClient的实例，按MessageService接口注入Messenger即可。
 * 
 * @author Mac_J
 *
 */
public class RocketMQClientEx extends RocketMQClient implements MessageService {

//	public com.boarsoft.message.bean.Message get(String from) throws Exception {
//		RocketMQDestination dest = destMap.get(from);
//		RocketMQConsumerEx consumer = (RocketMQConsumerEx) dest.getConsumer();
//		return consumer.get();
//	}

	@Override
	public void put(com.boarsoft.message.bean.Message msg) throws Exception {
		RocketMQDestination dest = destMap.get(msg.getTarget());
		RocketMQProducerEx producer = (RocketMQProducerEx) dest.getProducer();
		producer.put(msg);
	}
}